import os
from flask import Flask,jsonify, request,render_template,session
import pymysql
pymysql.install_as_MySQLdb()

app = Flask(__name__,template_folder='template',static_url_path='/static',static_folder='static')
app.secret_key = 'ylhyapi'

@app.route("/")
def index():
    return render_template('index.html')

def main():
    from controller.userManage import userManage
    app.register_blueprint(userManage)
    from controller.paymentInfo import paymentInfo
    app.register_blueprint(paymentInfo)
    from controller.loginCtrl import login
    app.register_blueprint(login)
    from controller.rightCtrl import right
    app.register_blueprint(right)
    from controller.right_moduleCtrl import right_module
    app.register_blueprint(right_module)
    from controller.right_rolesCtrl import right_roles
    app.register_blueprint(right_roles)
    from controller.org_departmentCtrl import org_department
    app.register_blueprint(org_department)
    from controller.org_deviceCtrl import org_device
    app.register_blueprint(org_device)
    from controller.org_teamMemberCtrl import org_teamMember
    app.register_blueprint(org_teamMember)
    from controller.adm_logCtrl import adm_log
    app.register_blueprint(adm_log)
    from controller.adm_cartCtrl import adm_cart
    app.register_blueprint(adm_cart)
    from controller.adm_deviceCtrl import adm_device
    app.register_blueprint(adm_device)
    from controller.adm_mbdeviceCtrl import adm_mbdevice
    app.register_blueprint(adm_mbdevice)
    from controller.down_fileCtrl import down_file
    app.register_blueprint(down_file)
    from controller.recharge_orderCtrl import recharge_order
    app.register_blueprint(recharge_order)
    from controller.recharge_accountCtrl import recharge_account
    app.register_blueprint(recharge_account)
    from controller.useTestCtrl import useTest
    app.register_blueprint(useTest)


    pass
main()
if __name__ == "__main__":
    print("启动程序")
    app.run(port=9526)